<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <div class="loading-container" v-if="loading">
        <a-spin size="large" />
      </div>
      <router-view></router-view>
    </div>
  </a-config-provider>
</template>

<script>
import zhCN from "ant-design-vue/lib/locale-provider/zh_CN";
export default {
  name: "App",
  components: {},
  data() {
    return {
      locale: zhCN,
      loading: false,
    };
  },
  created() {
    this.$router.beforeEach((to, from, next) => {
      this.loading = true;
      next();
    });
    this.$router.afterEach(() => {
      this.loading = false;
    });
  },
};
</script>

<style>
body,
html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
    Helvetica Neue, Arial, Noto Sans, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
}

#app {
  height: 100%;
  background: #f5f5f5;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.box {
  width: 100%;
  height: 100%;
  display: flex;
}
.global-spin-wrapper {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.5);
}
::v-deep .ant-table-thead > tr > th {
  color: #000;
  font-weight: bold !important;
}

.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background-color: rgba(255, 255, 255, 0.7);
}
</style>
